<template>
    <div class="nav-bar">
        <text v-if="totalNum > 0" class="btn font-msyhl" @click="btnClick">{{title}}</text>
        <text class="nav-bar-text font-msyhl">购物车</text>
    </div>
</template>

<style scoped>
    .nav-bar {
        position: absolute;
        left: 0;
        top: 0;
        width: 1080px;
        height: 80px;
        padding-left: 30px;
        padding-right: 30px;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        background-color: #f2f2f2;
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
    }
    .btn {
        position: absolute;
        left: 30px;
        top: 0;
        padding-left: 2px;
        padding-right: 12px;
        height: 80px;
        line-height: 80px;
        color: #313131;
        font-size: 30px;
    }
    .nav-bar-text {
        font-size: 30px;
        color: #313131;
        lines: 1;
        text-overflow: ellipsis;
    }
    .font-msyhl {
        font-family: msyhl;
    }
</style>

<script>
    export default{
        props: {
            totalNum: {
                type: String,
                default: 0
            },
            title: {
                type: String,
                default: '编辑'
            }
        },
        methods: {
            btnClick(e){
                this.$emit("btnClick",e);
            }
        }
    }
</script>
